package cn.afterturn.easypoi.word.entity.bookmark;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
/*@Data
@ToString(callSuper = true)
@EqualsAndHashCode()*/
@Entity
@Table(name = "bookMarkEntityVO", schema = "jeecg-boot-sjk", catalog = "")
public class BookMarkEntityVO {
    @Id
    @Column(name = "id")
    private String id;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBookMarkFromHFPC() {
        return bookMarkFromHFPC;
    }

    public void setBookMarkFromHFPC(String bookMarkFromHFPC) {
        this.bookMarkFromHFPC = bookMarkFromHFPC;
    }

    public int getBookmarkNoOfPara() {
        return bookmarkNoOfPara;
    }

    public void setBookmarkNoOfPara(int bookmarkNoOfPara) {
        this.bookmarkNoOfPara = bookmarkNoOfPara;
    }

    public String getBookmarkType() {
        return bookmarkType;
    }

    public void setBookmarkType(String bookmarkType) {
        this.bookmarkType = bookmarkType;
    }

    public String getBookmarkname() {
        return bookmarkname;
    }

    public void setBookmarkname(String bookmarkname) {
        this.bookmarkname = bookmarkname;
    }

    public String getBookmarkvalue() {
        return bookmarkvalue;
    }

    public void setBookmarkvalue(String bookmarkvalue) {
        this.bookmarkvalue = bookmarkvalue;
    }

    public int getBookvalueCount() {
        return bookvalueCount;
    }

    public void setBookvalueCount(int bookvalueCount) {
        this.bookvalueCount = bookvalueCount;
    }

    public ImageValueEntityVO getImageValueEntityVO() {
        return imageValueEntityVO;
    }

    public void setImageValueEntityVO(ImageValueEntityVO imageValueEntityVO) {
        this.imageValueEntityVO = imageValueEntityVO;
    }

    public Set<MultiValueEntityVO> getMultiValueEntityVOS() {
        return multiValueEntityVOS;
    }

    public void setMultiValueEntityVOS(Set<MultiValueEntityVO> multiValueEntityVOS) {
        this.multiValueEntityVOS = multiValueEntityVOS;
    }

    public ParagraphEntityVO getParagraphEntityVO() {
        return paragraphEntityVO;
    }

    public void setParagraphEntityVO(ParagraphEntityVO paragraphEntityVO) {
        this.paragraphEntityVO = paragraphEntityVO;
    }

    private String bookMarkFromHFPC;//书签来源只能在Header，Footer，Paragraph或Cell

    private int bookmarkNoOfPara;
    private String bookmarkType;//计算字段，普通字段
    //@NotBlank(message ="书签不能为空")
    private String bookmarkname;
    private String bookmarkvalue;//在解析文档的时候，不需要这个多值
    @JsonIgnore
    @Transient
    private int bookvalueCount;//暂时没有用
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "imagevalue_id")
    private ImageValueEntityVO imageValueEntityVO;//单值的时候从这个地方取,与bookmarkvalue是2个选择一个
    //@JsonIgnore
    @JsonIgnoreProperties("bookMarkEntityVO")
    @OneToMany(mappedBy = "bookMarkEntityVO",cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    private Set<MultiValueEntityVO> multiValueEntityVOS=new HashSet<>();//因为在解析文档的时候，不需要这个多值
    //然后在读入Excel的数据的时候，肯定设置


    //双向配置Jpa
    @JsonIgnoreProperties("bookMarkEntityVOS")
    @ManyToOne(cascade = CascadeType.ALL,optional = false,fetch = FetchType.LAZY)
    @JoinColumn(name = "fid"/*,foreignKey = @ForeignKey(name = "none",value = ConstraintMode.NO_CONSTRAINT)*/)
    private ParagraphEntityVO paragraphEntityVO;

}
